#include "bi_reconstruction.hpp"
#include "bi_constants.hpp"
#include "eigenConcat.hpp"
#include "reconstructionHelpers.hpp"

namespace hms::swe
{

EdgesValues mapEdgesValues( ArrayXXs& buf, Index nEdges ){

	assert( buf.cols() >= 2 * nReconstComp );
	assert( buf.rows() >= nEdges );

	auto colptr = [&](Index col){
		return buf.col(col).data();
	};
	#define MAP_AT_COL(COL, NCOMP) {{ \
		{colptr(COL), NCOMP, nEdges}, \
		{colptr(COL) + NCOMP*nEdges, NCOMP, nEdges} \
	}}
	return {
		MAP_AT_COL( 0, 1), // d
		MAP_AT_COL( 2, 1), // z
		MAP_AT_COL( 4, 1), // h
		MAP_AT_COL( 6, 2), // v
		MAP_AT_COL(10, 2), // vRot
		MAP_AT_COL(14, 1), // limiter function buffer for d, h
		MAP_AT_COL(14, 2)  // limiter function buffer for q. shares with d, h
	};
	#undef MAP_AT_COL
}


} // namespace hms::swe
